<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>平台管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <style>
        thead tr th{text-align: center!important;font-weight: bold!important;}
        tr td{text-align: center!important;}
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <div class="layui-col-md-offset11">
                        <button class="layui-btn layui-btn-sm layui-btn-normal" onclick="history.go(-1)">返回上一页</button>
                    </div>
                </div>
                <div class="layui-card-body">
                    <input type="hidden" name="parentid" value="${parentid}" id="parentid">
                    <input type="hidden" name="flag" value="${flag}" id="flag">
                    <table class="layui-table" lay-filter="customer-table" id="customer-table"></table>
                    <script type="text/html" id="index">
                        {{d.LAY_TABLE_INDEX+1}}
                    </script>
                    <script type="text/html" id="status">
                        {{#  if(d.status == 1){ }}
                        <span class="layui-badge layui-bg-green">正常</span>
                        {{# }else{ }}
                        <span class="layui-badge">冻结</span>
                        {{# }}}
                    </script>
                    <script type="text/html" id="money">
                        <span style="color: red">{{d.account.money.toFixed(2)}}</span>
                    </script>
                    <script type="text/html" id="point">
                        {{d.account.point.toFixed(2)}}
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form','table','laydate'], function(){
        var form = layui.form,table = layui.table,$ = layui.$,laydate=layui.laydate;

        laydate.render({
            elem: '#laydate-cn',
            range:'~'
        });

        table.render({
            elem:'#customer-table',
            url:'/customer/queryCustomerList',
            page:true,
            request:{
                pageName:'current',
                limitName:'size'
            },
            where:{'parentid':$('#parentid').val(),'flag':$('#flag').val()},
            cols:[[
                {field:'id',title:'序号',width:80,fixed:'left',templet:'#index'},
                {field:'nickName',title:'昵称',minWidth:150,fixed:'left'},
                {field:'phone',title:'账号',minWidth:120},
                {field:'levelName',title:'等级',minWidth:100},
                {field:'parentName',title:'推荐人',minWidth:120,templet:'#need'},
                {field:'directNum',title:'直推数',minWidth:90,sort:true},
                {field:'indirectNum',title:'间推数',minWidth:90,sort:true},
   				{field:'normalNum', title : '普通会员数', minWidth:90,sort:true},
   				{field:'pioneerNum', title:'创业会员数', minWidth:90,sort:true},
                {field:'money',title:'剩余金额',minWidth:100,sort:true,templet:'#money'},
                {field:'point',title:'剩余积分',minWidth:100,sort:true,templet:'#point'},
   				{field:'account.donate', title:'贡献值', minWidth:100,sort:true, templet:"<div>{{d.account.donate}}</div>"},
   				{field:'account.share', title:'共享值', minWidth:100,sort:true, templet:"<div>{{d.account.share}}</div>"},
                {field:'channelName',title:'用户来源',minWidth:100},
                {field:'realName',title:'真实姓名',minWidth:100},
                {field:'remarkname',title:'平台备注',minWidth:100},
                {field:'status',title:'状态',minWidth:80,templet:'#status'},
                {field:'createtime',title:'注册时间',minWidth:170,sort:true,
                    templet:"<div>{{layui.util.toDateString(d.createtime,'yyyy-MM-dd HH:mm:ss')}}</div>"},
            ]]
        });
    });
</script>
</body>
</html>